# 运算符
# ____________________________________________________________
# 1.算术运算符 + - # / % ** //

# 加减乘除 + - * /

# 取模 %、幂 ** 取整除 //
"""
a = 21
b = 10
c = 0

c = a + b
print("加法：c = ", c)
c = a - b
print("减法：c = ", c)
c = a * b
print("乘法：c = ", c)
c = a / b
print("触发：c = ", c)

a = 2
b = 3
c = a // b
print("取整：c = ", c)

a = 10
b = 2
c = a // b
print("取整：c = ", c)
c = b ** 3
print("取幂：c = ", c)

print("小数整除 ", 1.0 /2)
"""
# ____________________________________________________________
# 2.比较运算符 ==、!=、 <>、 >、 <、 >=、 <=
# (!= 与 <> 都为不等于)


"""
a = 21
b = 10
c = 0

if a == b:
    print("等于")
else:
    print("不等于")

if a != b:
    print("不等于")
if a > b:
    print("大于")
elif a < b:
    print("小于")
"""
# ____________________________________________________________

# python赋值运算符
# += -= *= /= %= **= //=
"""
a = 21
b = 2
c = 3
c += a
print(c)
c -= a
print(c)
c *= a
print(c)
c = 3
c /= a
print(c)
c = 3
c %= a
print(c)
c = 3
c **= b
print(c)
c = 3
c //= a
print(c)
"""

# ____________________________________________________________
# Python位运算符
"""
a = 0b0011
b = 0b0000                  #0b二进制前缀

print(a & b)                #按位与
print(a | b)                #按位或
print(a ^ b)                #异或
print(~a)                   #按位取反
print(a<<2)                 #左移2位
print(a>>2)                 #右移2位

"""
# ____________________________________________________________
# Python逻辑运算
# and or not()
"""
a = 10
b = 20

if a and b:
    print("变量 a 和 b 为 true")
else:
    print("变量 a 和 b 为 false")
if not (a and b):
    print("a 与 b 其中一个是false")
else:
    print("a 与 b 都为ture")
"""

# ____________________________________________________________
# Python 成员函数运算符
# in /not in
"""
a = 10
b = 0
list = [1,2,3,4,10]

if(a in list):
    print("a 在 list中")
else:
    print("a 不在 list中")

"""

# ____________________________________________________________
# Python 身份运算符
# is / is not:判断两个标识符,是否引用不同对象

"""
a = 20
b = 20
if (a is b):
    print("a 与 b 有相同的标识")
else:
    print("a 与 b 没有相同的标识")

print("______________________")

a = [1, 2, 3]
b = a
if (a is b):
    print("a 与 b 相同对象")
else:
    print("a 与 b 不同对象")
c = [1, 2, 3]
if (a is c):
    print("a 与 c 相同对象")
else:
    print("a 与 c 不同对象")
    
"""
# ____________________________________________________________

# Python 符号优先级：
# **
# ~、+@、-@
# *、/ 、#、//
# >> 、<<
# &
# ^|
# <=、<、>、>=
# <>、==、!=
# =、%= 、/=、//=、-=、+=、*=、**=
# is、is not
# in、not in
# not、and、or
"""
a = 20
b = 10
c = 15
d = 5
e = 0

e = (a + b) * c / d
print("(a + b) * c /d = " + str(e))

e = ((a + b) * c) / d
print("((a + b) * c) / d = " + str(e))

e = (a + b) * (c + d)
print("(a + b) * (c + d) = " +str(e))

e = a + (b * c) / d
print("a + (b * c) / d = " + str(e))
"""

# ____________________________________________________________

